<%@ tag pageEncoding="UTF-8"%>
<%@ attribute name="page" required="true" type="cn.org.rapid_framework.page.Page" description="Page.java" %>
<%@ attribute name="pageSizeSelectList" type="java.lang.Number[]" required="false"  %>
<%@ attribute name="isShowPageSizeList" type="java.lang.Boolean" required="false"  %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
	Integer[] defaultPageSizes = new Integer[]{5,10,15,20,25,30,40,50,100};
	if(jspContext.getAttribute("pageSizeSelectList") == null) {
		jspContext.setAttribute("pageSizeSelectList",defaultPageSizes); 
	}
	
	if(jspContext.getAttribute("isShowPageSizeList") == null) {
		jspContext.setAttribute("isShowPageSizeList",true); 
	} 
%>

<c:if test="${page.lastPageNumber>1}">
<div class="porl_pagination">
	<span>${page.thisPageNumber}</span>/${page.lastPageNumber}
	<c:choose>
		<c:when test="${page.firstPage}"><i class="icon-h page-home_disabled" title="第一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, 1, '');"></i></c:when>
		<c:otherwise><i class="icon-h page-home" title="第一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, 1, '');"></i></c:otherwise>
	</c:choose>
	<c:choose>
		<c:when test="${page.hasPreviousPage}"><i class="icon-h page-prev" title="上一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, ${page.previousPageNumber}, '');"></i></c:when>
		<c:otherwise><i class="icon-h page-prev_disabled" title="上一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, 1, '');"></i></c:otherwise>
	</c:choose>
	
	<c:choose>
		<c:when test="${page.hasNextPage}"><i class="icon-h page-next" title="下一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, ${page.nextPageNumber}, '');"></i></c:when>
		<c:otherwise><i class="icon-h page-next_disabled" title="下一页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, ${page.nextPageNumber}, '');"></i></c:otherwise>
	</c:choose>
	
	<c:choose>
		<c:when test="${page.lastPage}"><i class="icon-h page-end_disabled" title="尾页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, ${page.lastPageNumber}, '');"></i></c:when>
		<c:otherwise><i class="icon-h page-end" title="尾页" onclick="javascript:com.milan.portlet.PortletUtils.pageTo(this, ${page.lastPageNumber}, '');"></i></c:otherwise>
	</c:choose>
</div>
</c:if>
